package com.dylan.历史;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created by Dylan on 2018/9/7.
 */
public class Test11 {

    public static void main(String[] args) {
//        List<String> b1 = Stream.of("一般检查", "内科", "外科", "妇科（女性有性生活史者）", "眼科", "耳鼻喉科", "口腔科", "心电图", "放射检查", "肺功能检测", "腹部彩超（空腹）", "妇科彩超（憋尿）", "前列腺彩超（憋尿）", "血常规", "肝功能（8项）", "心肌酶谱4项", "肾功能", "血脂（4项）", "糖尿病筛查", "醛固酮及肾素检测", "胃幽门螺旋杆菌筛查", "肿瘤标志物", "同型半胱氨酸", "尿液分析", "粪便分析", "双乳腺彩超", "双侧颈动脉血管彩超", "甲状腺彩超", "甲功七项", "早期胃癌筛查", "胃蛋白酶原I、胃蛋白酶原II、比值", "肺肿瘤四项", "HPV病毒检测（已婚）", "早期肾损伤筛查", "糖化血红蛋白", "骨密度", "PEM-CTM测试").collect(Collectors.toList());
//        List<String> b2 = Stream.of("一般检查", "内科", "外科", "妇科（女性有性生活史者）", "眼科", "耳鼻喉科", "口腔科", "心电图", "放射检查", "肺功能检测", "腹部彩超（空腹）", "乳腺彩超", "甲状腺彩超", "妇科彩超（憋尿）", "前列腺彩超（憋尿）", "血常规", "肝功能（8项）", "心肌酶谱4项", "肾功能", "血脂（4项）", "糖尿病筛查", "胃幽门螺旋杆菌筛查", "肿瘤标志物", "同型半胱氨酸", "尿液分析", "粪便分析", "双侧颈动脉血管彩超", "甲功七项", "早期胃癌筛查", "胃蛋白酶原I、胃蛋白酶原II、比值", "肺肿瘤四项", "HPV病毒检测（已婚）", "早期肾损伤筛查", "继发高血压五项", "糖化血红蛋白", "QCT", "PEM-CTM测试").collect(Collectors.toList());
//        List<String> b11 = new ArrayList<>(b1);
//        b11.removeAll(b2);
//        List<String> b22 = new ArrayList<>(b2);
//        b22.removeAll(b1);
//        System.out.println(b11);
//        System.out.println(b22);

        Random random = new Random();
        long[][] a = new long[1024 * 1024][8];
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[i].length; j++) {
                a[i][j] = random.nextInt(1000);
            }
        }
        long start = System.currentTimeMillis();
        long sum = 0;
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[i].length; j++) {
                sum = sum + a[i][j];
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);
        long start1 = System.currentTimeMillis();
        long sum1 = 0;
        for (int j = 0; j < 8; j++) {
            for (int i = 0; i < 1024 * 1024; i++) {
                sum1 = sum1 + a[i][j];
            }
        }
        long end1 = System.currentTimeMillis();
        System.out.println(end1 - start1);
    }

}
